package com.xm.service.background;

import com.xm.dao.background.CommoditySpecificationTypeDao;
import com.xm.entity.CommoditySpecificationType;
import com.xm.exception.SqlErrorException;

import java.util.List;

/**
 * 商品规格类别
 * @author 康文程
 * @date 2024-1-17
 */
public class CommoditySpecificationTypeService {
    private final CommoditySpecificationTypeDao dao = new CommoditySpecificationTypeDao();
    /**
     * 新增商品规格类型
     *
     * @param specificationTypeName 规格类型名称
     * @return 新增成功返回true，失败返回false
     * @throws SqlErrorException SQL执行异常
     */
    public boolean insertCommoditySpecificationType(String specificationTypeName) throws SqlErrorException {
        return dao.insertCommoditySpecificationType(specificationTypeName);
    }
    /**
     * 查询全部商品规格类别
     *
     * @return 商品规格类别
     * @throws SqlErrorException SQL执行异常
     */
    public List<CommoditySpecificationType> getAllCommoditySpecificationTypes() throws SqlErrorException {
        return dao.getAllCommoditySpecificationTypes();
    }
}
